From: Jasper St. Pierre Date: Tue, 6 Aug 2013 13:22:48 +0000 (-0400) Subject: screenShield: Don't crash when trying to deactivate the shield X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3816 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=eec4334a781684bf58f12eb88c598e5e3d21c26a;p=gnome-shell.git screenShield: Don't crash when trying to deactivate the shield If the user has a lock delay, or deactivate() has been called at any other time, we need to check for the unlock dialog, as it may not always exist. --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 151f70b4c..38ac63e7f 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -1123,9 +1123,12 @@ const ScreenShield = new Lang.Class({ }, deactivate: function(animate) { - this._dialog.finish(Lang.bind(this, function() { + if (this._dialog) + this._dialog.finish(Lang.bind(this, function() { + this._finishDeactivate(animate); + })); + else this._finishDeactivate(animate); - })); }, _finishDeactivate: function(animate) {